<!--
/**************************************************
* @ payreceivestatusquery.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/02/12, Simonyi Peng
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../../common.jsp" %>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>

<html>
<head>
<title>收付款状况查询</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>

<%
ArrayList deptList = new ArrayList();
ArrayList addrList = new ArrayList();

ArrayList ary = (ArrayList)request.getAttribute("organdaddr");
deptList = (ArrayList)ary.get(0);
addrList = (ArrayList)ary.get(1);


ResultProcess tstatusList = (ResultProcess)request.getAttribute("statuslist");
GSPayReceiveStatusQueryVO oaqVO = (GSPayReceiveStatusQueryVO)session.getAttribute("QUERYCONDITION");
ArrayList tList = null;
%>
<script>
	var counter;

	var deptlist = new Array();
	//初始化
	<%for(int i=0;i<deptList.size();i++){%>
		deptlist[<%=i%>] = '<%=deptList.get(i)%>';
	<%}%>	

	function process(val){
		if(val == 'Q'){
			payreceivequeryform.action = "<%=response.encodeURL(root+"/A180602.do")%>";
    		payreceivequeryform.submit();			
    		return false;
		}
	}
	
	function cls(){
		document.all.deptid.options[0].selected=true;
		document.all.provname.value="";
		document.all.workcorpcategory.options[0].selected=true;
		document.all.paytype.options[0].selected=true;
		document.all.payreceivedatestart.value="";
		document.all.payreceivedateend.value="";
	}	
	
	
</script>
</head>
<body BGCOLOR="#f5f5f5"	text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black">收付款状况查询</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>

<br>


<form name="payreceivequeryform" method="get" >
<input type='hidden' name='actionvalue' value=''>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<TD class="bg_column" align=center>公司名称</TD>
					<TD align=left class="bg_row_odd">
						<select name="deptid">
							<option value=''>--全部--</option>
                    		<%
                    		for(int i=0;i<deptList.size();i++){
                    			String dept = (String)deptList.get(i);
						        StringTokenizer st = new StringTokenizer(dept,"|");
						        String[] tmp = new String[2] ;
						        int index =0;
						        while(st.hasMoreElements()){
						            tmp[index++] = (String)st.nextElement();
						        }
                    		%>
                        		<option value='<%=tmp[0]%>' <%if(tmp[0].equals(oaqVO==null?"":(oaqVO.deptid==null?"":oaqVO.deptid))) out.print("selected");%>><%=tmp[1]%></option>
                    		<%
                    		}
                    		%>					
						</select>
					</TD>					
					<TD class="bg_column" align=center>供应商</TD>
					<TD align=left class="bg_row_odd">
						<input type="text" name="provname" maxlength="20" value="<%=oaqVO==null?"":(oaqVO.provname==null?"":oaqVO.provname)%>">
					</TD>					
				</TR>
				<TR height=20>
					<TD class="bg_column" align=center>结算对象类型</TD>
					<TD align=left class="bg_row_odd">
						<select name="workcorpcategory">
							<option value='0'>--全部--</option>
							<option value='1' <%if(oaqVO!=null && "1".equals(oaqVO.workcorpcategory)) out.print("selected");%>>结算单位</option>
							<option value='2' <%if(oaqVO!=null && "2".equals(oaqVO.workcorpcategory)) out.print("selected");%>>供货商</option>
						</select>
					</TD>					
					<TD class="bg_column" align=center>收付款类型</TD>
					<TD align=left class="bg_row_odd">
						<select name="paytype">
							<option value='0'>--全部--</option>
							<option value='1' <%if(oaqVO!=null && "1".equals(oaqVO.paytype)) out.print("selected");%>>收款</option>
							<option value='2' <%if(oaqVO!=null && "1".equals(oaqVO.paytype)) out.print("selected");%>>付款</option>
						</select>
					</TD>					
				</TR>
<!--
				<TR height=20>
					<TD class="bg_column" align=center>收付款状态</TD>
					<TD align=left class="bg_row_odd" colspan=3>
						<select name="paystatus">
							<option value='0'>--全部--</option>
							<option value='1' <%//if(oaqVO!=null && "1".equals(oaqVO.paystatus)) out.print("selected");%>>未完成</option>
							<option value='2' <%//if(oaqVO!=null && "1".equals(oaqVO.paystatus)) out.print("selected");%>>部分完成</option>
							<option value='2' <%//if(oaqVO!=null && "1".equals(oaqVO.paystatus)) out.print("selected");%>>全部完成</option>
						</select>
					</TD>					
				</TR>
-->
				<TR height=20>
					<TD class="bg_column" align=center>收付款日期</TD>
					<TD align=left class="bg_row_odd" colspan=3>
						<input type="text" size='10' name="payreceivedatestart" maxlength="20" readonly onfocus='setday(this)' value="<%=oaqVO==null?"":(oaqVO.payreceivedatestart==null?"":oaqVO.payreceivedatestart)%>">~
						<input type="text" size='10' name="payreceivedateend" maxlength="20" readonly onfocus='setday(this)' value="<%=oaqVO==null?"":(oaqVO.payreceivedatestart==null?"":oaqVO.payreceivedateend)%>">
					</TD>					
				</TR>
			</table>
		</td>
	</tr>
</table>
<%if(tstatusList != null){
    int totalRecords = 0;
    if(request.getAttribute("totalRecords")!=null){
        totalRecords=Integer.parseInt((String)request.getAttribute("totalRecords"));
    }
    int defaultPageSize =10;
    if(request.getAttribute("pageSize")!=null){
        defaultPageSize=Integer.parseInt((String)request.getAttribute("pageSize"));
    }
            %>          
            <page:pager total='<%=totalRecords%>' defaultPageSize='<%=defaultPageSize%>'></page:pager>
            <%} %>
</form>
    <p align="center">  
		<input type="button" width="58" class="kuang" height="24" value="查询" onclick="process('Q')"/>&nbsp;
		<input type="button" width="58" class="kuang" height="24" value="清空" onclick="cls()"/>
    </p>

<%
	
	if(tstatusList != null){
%>
	<center>
    <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
		<tr>
			<td>
            <form name='pager' method="post">
            <input type="hidden" name="currentrownum">
            	<table class=bg_table id=tableId	cellspacing=1 cellpadding=2 width=100% align=center border=0>
                    <tbody> 
                    <tr class="bg_column" height=20> 
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">详细</div>
						</td>	
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">公司名称</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">类型</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">金额（元）</div>
						</td>									
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">收（付）款日期</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">负责（联系）人</div>
						</td>
																																			
					</tr>
					<%
						tList = tstatusList.getAllRecoreds();
						if(tList != null && tList.size() > 0){
						for(int i=0; i<tList.size(); i++){
//							String[] tStr = (String[])tList.get(i);
							GSPayReceiveMentStatusListVO vo = (GSPayReceiveMentStatusListVO)tList.get(i);
							String tTempStr="";
							if(i%2==0){
								tTempStr="class=\"bg_row_odd\"";
							}else {
								tTempStr="class=\"bg_row_even\"";
							}

					%>

							<tr <%=tTempStr%> height=20>
								<td class=top align=middle > 
									<div align="center" class="txt_content">
									<a href="<%=response.encodeURL(root+"/A180603.do")%>?payreceivementId=<%=vo.workcorpid+","+vo.paydate%>" target="_blank">详细</a>
									</div>
								</td>								
								<td class=top align=middle  > 								
									<div align="center" class="txt_content">
									<%=vo.deptname%>
									</div>
								</td>	
								<td class=top align=middle > 
									<div align="center" class="txt_content">
									<%="1".equals(vo.paytype)?"收款":"付款"%>
									</div>
								</td>	
								<td class=top align=middle > 
									<div align="center" class="txt_content">
									<%=vo.paynum%>
									</div>
								</td>
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=vo.paydate%>
									</div>
								</td>			
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=vo.principal%>
									</div>
								</td>				
																																							
							</tr> 
							
					<%	
						}
					%>
						  <tr class="bg_column" height=20>
						    <td width="960" height="16" colspan="16" align="right">
									<!--导航条-->
						    		<page:navigator type='text' queryForm="payreceivequeryform"/>
						    </td>
						  
				    <%
						}else{
					%>
							<font color="red">没有符合条件的收付款状况信息</font>
					<%
						}
					%>
					</tbody>
				</table>
				</form>					  
			</td>
		</tr>
	</table>
	</center>
	<p align="center">  
    	<!--input type="button" class="kuang" value="保存修改" onclick="process('T')"-->
    </p>
	
<%		
	}
%>

</body>
</html>